/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.system.ComFileMapper;
public class ComFile extends BaseAction
{
    @Autowired(required=false)
	private ComFileMapper mapper;
    public void hasPermission(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
    }
    /**
    公司文件
    */
    
    public Map comFile() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        Object filemenu =mapper.filemenu(params);
        result.put("filemenu", filemenu);
        
        
        tb = createTreeBean("s_tree_treecols");
        tb.setPrefix("img");
        SQLList<SQLMap> s_tree=mapper.s_tree(params);
        s_tree = s_tree.buildTree(tb,tb.getPid());
        result.put("s_tree", s_tree);
        
        return result;
    }
    /**
    文件列表公司
    */
    
    public Map comFileList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("CMID9",-1);
        SQLList<SQLMap> s_folder=mapper.s_folder(params);
        result.put("s_folder", s_folder);
        
        
        params.def("CMID9",-1);
        SQLList<SQLMap> s_tree_menu=mapper.s_tree_menu(params);
        result.put("s_tree_menu", s_tree_menu);
        
        return result;
    }
    /**
    */
    
    public Object s_file() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> p_file=mapper.p_file(params,pagination);
        p_file.setPagedListInfo(pagination);
        result.put("p_file", p_file);
        
        return p_file;
    }
    /**
    转移文件公司
    */
    
    public Map comFileMove() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_folders_treecols");
        tb.setPrefix("img");
        SQLList<SQLMap> s_folders=mapper.s_folders(params);
        s_folders = s_folders.buildTree(tb,tb.getPid());
        result.put("s_folders", s_folders);
        
        return result;
    }
    /**
    文件版本公司
    */
    
    public Map comFileVersion() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_file_version=mapper.s_file_version(params);
        result.put("s_file_version", s_file_version);
        
        return result;
    }
    /**
    上传文件
    */
    
    public Map uploadFileComFile() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("ts_files", create_code(18,"files_barcode"));
        
        return result;
    }
    /**
    上传文件公司
    */
    
    public Map comFileUpload() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_1=mapper.s_1(params);
        result.put("s_1", s_1);
        
        return result;
    }
    /**
    增加版本公司
    */
    
    public Map comFileAddVersion() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_file=mapper.s_file(params);
        SQLMap s_file_emt=s_file.getExistfirst();
        result.put("s_file", s_file_emt);
        
        return result;
    }
    /**
    新文件公司
    */
    
    public Map comFileFolder() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> newfile=mapper.newfile(params);
        SQLMap newfile_emt=newfile.getExistfirst();
        result.put("newfile", newfile_emt);
        
        return result;
    }
    /**
    搜索文件公司
    */
    
    public Map comFileSearch() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> s_project_files=mapper.s_project_files(params,pagination);
        s_project_files.setPagedListInfo(pagination);
        result.put("s_project_files", s_project_files);
        
        return result;
    }
    /**
    */
    
    public Map unzip() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> unzipList=mapper.unzipList(params);
        result.put("unzipList", unzipList);
        
        
        
        
        for (SQLMap emt:unzipList){
            params=new SQLParam(request,emt.getMap());
            mapper.unzip_files(params);
        }
        
        
        for (SQLMap emt:unzipList){
            params=new SQLParam(request,emt.getMap());
            mapper.unzip_files_version(params);
        }
        
        
        int unzip_status = mapper.unzip_status(params);
        result.put("unzip_status", unzip_status);
        
        return result;
    }
    /**
    */
    
    public Map down() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        return result;
    }
    /**
    */
    
    public Map move_files() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.move_files(params);
        
        return result;
    }
    /**
    */
    
    public Map d_files_version() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_files_version(params);
        
        return result;
    }
    /**
    上传文件修改
    */
    
    public Map uploadFileComFileSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.uploadFileComFileSubmit(params);
        
        return result;
    }
    /**
    上传文件公司修改
    */
    
    public Map comFileUploadSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        return result;
    }
    /**
    搜索文件公司修改
    */
    
    public Map comFileSearchSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        return result;
    }
}